import { useEffect, useState } from 'react';
import { Input, Button } from 'antd';
import styles from './index.module.scss';
import { captcha } from '@/service';

export default props => {
    const { value, onChange, onVerify, captchaUrl } = props;
    // 点击刷新验证码
    const refreshCaptcha = () => {
        onVerify();
    };
    return (
        <div className={styles['container']}>
            <div className={styles['input']}>
                <Input placeholder="Please enter" value={value} onChange={onChange} />
            </div>
            <div className={styles['captcha']}>
                    <img
                        src={captchaUrl}
                        alt="Captcha"
                        style={{ cursor: 'pointer' }}
                        onClick={refreshCaptcha}
                    />
            </div>
        </div>
    )
}
